home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE21 / AUTOPLAY / AUTOPLAY.ZIP / AutoPlay / Demo / unit1.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1997-04-09  |  3.4 KB  |  151 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses          
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls, AutoPlay, ExtCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     AutoPlay1: TAutoPlay;
  12.     AutoPlay2: TAutoPlay;
  13.     AutoPlay3: TAutoPlay;
  14.     Button1: TButton;
  15.     Button2: TButton;
  16.     Button3: TButton;
  17.     Label1: TLabel;
  18.     Label2: TLabel;
  19.     Label3: TLabel;
  20.     Label4: TLabel;
  21.     Label5: TLabel;
  22.     Label6: TLabel;
  23.     Label7: TLabel;
  24.     Label8: TLabel;
  25.     Label9: TLabel;
  26.     Label10: TLabel;
  27.     AutoPlay4: TAutoPlay;
  28.     Label11: TLabel;
  29.     AutoPlay5: TAutoPlay;
  30.     Label12: TLabel;
  31.     AutoPlay6: TAutoPlay;
  32.     Label13: TLabel;
  33.     Panel1: TPanel;
  34.     Button4: TButton;
  35.     Label14: TLabel;
  36.     Button5: TButton;
  37.     Button6: TButton;
  38.     AutoPlay7: TAutoPlay;
  39.     Bevel1: TBevel;
  40.     Bevel2: TBevel;
  41.     Timer1: TTimer;
  42.     Label15: TLabel;
  43.     procedure Button1Click(Sender: TObject);
  44.     procedure Button2Click(Sender: TObject);
  45.     procedure AutoPlay1Click(Sender: TObject);
  46.     procedure Button3Click(Sender: TObject);
  47.     procedure AutoPlay2DblClick(Sender: TObject);
  48.     procedure AutoPlay2Play(Sender: TObject);
  49.     procedure AutoPlay2Stop(Sender: TObject);
  50.     procedure Button4Click(Sender: TObject);
  51.     procedure Button5Click(Sender: TObject);
  52.     procedure Button6Click(Sender: TObject);
  53.     procedure Timer1Timer(Sender: TObject);
  54.     procedure AutoPlay4RClick(Sender: TObject);
  55.   private
  56.     { Private declarations }
  57.   public
  58.     { Public declarations }
  59.   end;
  60.  
  61. var
  62.   Form1: TForm1;
  63.   AValue:integer = 0;
  64.  
  65. implementation
  66.  
  67. {$R *.DFM}
  68.  
  69. procedure TForm1.Button1Click(Sender: TObject);
  70. begin
  71.    AutoPlay1.GetDIB('se_hello.bmp');
  72.    AutoPlay2.GetDIB('se_hello.bmp');
  73.    AutoPlay3.GetDIB('se_hello.bmp');
  74.    AutoPlay4.GetDIB('se_hello.bmp');
  75.    AutoPlay5.GetDIB('se_hello.bmp');
  76.    AutoPlay6.GetDIB('se_hello.bmp');
  77.    AutoPlay7.GetDIB('se_hello.bmp');
  78.    AValue := 1;
  79. end;
  80.  
  81. procedure TForm1.Button2Click(Sender: TObject);
  82. begin
  83.    AutoPlay1.Play;
  84.    AutoPlay2.BackPlay;
  85.    AutoPlay3.PlaySection(10,20);
  86.    AutoPlay4.Play;
  87.    AutoPlay5.Play;
  88.    AutoPlay6.BackPlay;
  89.    AutoPlay7.Play;
  90. end;
  91.  
  92. procedure TForm1.AutoPlay1Click(Sender: TObject);
  93. begin
  94.    MessageBox(0,'Hello','Hello',MB_OK);
  95. end;
  96.  
  97. procedure TForm1.Button3Click(Sender: TObject);
  98. begin
  99.    AutoPlay1.Stop;
  100.    AutoPlay2.Stop;
  101.    AutoPlay3.Stop;
  102.    AutoPlay4.Stop;
  103.    AutoPlay5.Stop;
  104.    AutoPlay6.Stop;
  105.    AutoPlay7.Stop;
  106. end;
  107.  
  108. procedure TForm1.AutoPlay2DblClick(Sender: TObject);
  109. begin
  110.    MessageBox(0,'Hello!Hello!','Hello',MB_OK)
  111. end;
  112.  
  113. procedure TForm1.AutoPlay2Play(Sender: TObject);
  114. begin
  115.    label10.visible := false
  116. end;
  117.  
  118. procedure TForm1.AutoPlay2Stop(Sender: TObject);
  119. begin
  120.    label10.visible := true
  121. end;
  122.  
  123. procedure TForm1.Button4Click(Sender: TObject);
  124. begin
  125.    SetThreadPriority(AutoPlay2.ThreadHandle,THREAD_PRIORITY_HIGHEST)
  126. end;
  127.  
  128. procedure TForm1.Button5Click(Sender: TObject);
  129. begin
  130.    SetThreadPriority(AutoPlay2.ThreadHandle,THREAD_PRIORITY_LOWEST)
  131. end;
  132.  
  133. procedure TForm1.Button6Click(Sender: TObject);
  134. begin
  135.    SetThreadPriority(AutoPlay2.ThreadHandle,THREAD_PRIORITY_IDLE)
  136. end;
  137.  
  138. procedure TForm1.Timer1Timer(Sender: TObject);
  139. begin
  140.    AutoPlay7.Top := AutoPlay7.Top + AValue;
  141.    if (AutoPlay7.Top > 200) then AValue := -1;
  142.    if (AutoPlay7.Top < 27)  then AValue := 1
  143. end;
  144.  
  145. procedure TForm1.AutoPlay4RClick(Sender: TObject);
  146. begin
  147.    MessageBeep(0)
  148. end;
  149.  
  150. end.
  151.